-- GENERATED SPELL FOR [Voidshrieker] --


function spell0_18870(pUnit, Event) --@Arcane Missiles,n/a--
pUnit:FullCastSpellOnTarget(34447,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18870', 531, 1)
end

function spell1_18870(pUnit, Event) --@Coalesce,Self--
pUnit:FullCastSpellOnTarget(34302,pUnit)
pUnit:RegisterEvent('Sorts_18870', 1500, 1)
end

function spell2_18870(pUnit, Event) --@Damage Reduction: Arcane,Self--
pUnit:FullCastSpellOnTarget(34331,pUnit)
pUnit:RegisterEvent('Sorts_18870', 659, 1)
end

function spell3_18870(pUnit, Event) --@Damage Reduction: Fire,Self--
pUnit:FullCastSpellOnTarget(34333,pUnit)
pUnit:RegisterEvent('Sorts_18870', 588, 1)
end

function spell4_18870(pUnit, Event) --@Damage Reduction: Frost,Self--
pUnit:FullCastSpellOnTarget(34334,pUnit)
pUnit:RegisterEvent('Sorts_18870', 548, 1)
end

function spell5_18870(pUnit, Event) --@Damage Reduction: Holy,Self--
pUnit:FullCastSpellOnTarget(34336,pUnit)
pUnit:RegisterEvent('Sorts_18870', 585, 1)
end

function spell6_18870(pUnit, Event) --@Damage Reduction: Nature,Self--
pUnit:FullCastSpellOnTarget(34335,pUnit)
pUnit:RegisterEvent('Sorts_18870', 604, 1)
end

function spell7_18870(pUnit, Event) --@Damage Reduction: Shadow,Self--
pUnit:FullCastSpellOnTarget(34338,pUnit)
pUnit:RegisterEvent('Sorts_18870', 694, 1)
end

function spell8_18870(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(34348,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18870', 2000, 1)
end

function spell9_18870(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(34347,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18870', 6000, 1)
end

function spell10_18870(pUnit, Event) --@Holy Bolt,n/a--
pUnit:FullCastSpellOnTarget(34346,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18870', 2000, 1)
end

function spell11_18870(pUnit, Event) --@Lightning Bolt,n/a--
pUnit:FullCastSpellOnTarget(34345,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18870', 2000, 1)
end

function spell12_18870(pUnit, Event) --@Psychic Scream,Self--
pUnit:FullCastSpellOnTarget(22884,pUnit)
pUnit:RegisterEvent('Sorts_18870', 4330, 1)
end

function spell13_18870(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(34344,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18870', 2000, 1)
end

function Sorts_18870(pUnit, Event)
local choix_sorts_18870 = math.random(0, 13)
if choix_sorts_18870 == 0 then
pUnit:RegisterEvent('spell0_18870', 1, 1)
end
if choix_sorts_18870 == 1 then
pUnit:RegisterEvent('spell1_18870', 1, 1)
end
if choix_sorts_18870 == 2 then
pUnit:RegisterEvent('spell2_18870', 1, 1)
end
if choix_sorts_18870 == 3 then
pUnit:RegisterEvent('spell3_18870', 1, 1)
end
if choix_sorts_18870 == 4 then
pUnit:RegisterEvent('spell4_18870', 1, 1)
end
if choix_sorts_18870 == 5 then
pUnit:RegisterEvent('spell5_18870', 1, 1)
end
if choix_sorts_18870 == 6 then
pUnit:RegisterEvent('spell6_18870', 1, 1)
end
if choix_sorts_18870 == 7 then
pUnit:RegisterEvent('spell7_18870', 1, 1)
end
if choix_sorts_18870 == 8 then
pUnit:RegisterEvent('spell8_18870', 1, 1)
end
if choix_sorts_18870 == 9 then
pUnit:RegisterEvent('spell9_18870', 1, 1)
end
if choix_sorts_18870 == 10 then
pUnit:RegisterEvent('spell10_18870', 1, 1)
end
if choix_sorts_18870 == 11 then
pUnit:RegisterEvent('spell11_18870', 1, 1)
end
if choix_sorts_18870 == 12 then
pUnit:RegisterEvent('spell12_18870', 1, 1)
end
if choix_sorts_18870 == 13 then
pUnit:RegisterEvent('spell13_18870', 1, 1)
end
end

function mob18870_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18870', math.random(1500, 3000), 1)
end

function mob18870_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18870_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18870_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18870, 1, 'mob18870_Action')
RegisterUnitEvent(18870, 2, 'mob18870_Leave')
RegisterUnitEvent(18870, 3, 'mob18870_Kill')
RegisterUnitEvent(18870, 4, 'mob18870_Die')
